import './App.css';
import {Routes,Route} from 'react-router-dom'
import Login from './views/Login/Login'
import Register from './views/Login/Register';
import Lay_out from './views/Layout/Layout';
import Summary_data from './views/System/Summary_data/Summary_data.js'
import User_data from './views/System/User_data/User_data.js'
import Products_data from './views/System/Products_data/Products_data.js'
import Data_list from './views/System/Products_data/Data_list.js';
import Add from './views/System/Products_data/Add.js';
import Products_control from './views/System/Products_control/Products_control.js'
import Orders_form from './views/System/Orders_form'
import Ads from './views/System/Ads/Ads.js'
import AdsTable from './views/System/Ads/AdsTable.js'
import Add_ads from './views/System/Ads/Add_ads'
import NeedAuth from './components/NeedAuth/NeedAuth.js';
import 'chart.js/auto';



function App() {


  

  return (
   <>
   <Routes>
    <Route path='/' element={<Login/>}></Route>
    <Route path='register' element={<Register/>}></Route>
    <Route path='home' element={
      <NeedAuth>
        <Lay_out/>
      </NeedAuth>}>

        <Route path='summary_data' element={<Summary_data/>}></Route>
        <Route path='user_data' element={<User_data/>}></Route>
        <Route path='products_data' element={<Products_data/>}>
          <Route path='list' element={<Data_list/>}></Route>
          <Route path='add' element={<Add/>}></Route>
        </Route>
        <Route path='products_control' element={<Products_control/>}></Route>
        <Route path='orders_form' element={<Orders_form/>}></Route>
        <Route path='ads' element={<Ads/>}>
          <Route path='list_ads' element={<AdsTable/>}></Route>
          <Route path='add_ads' element={<Add_ads/>}></Route>
        </Route>
    </Route>

   </Routes>
   
   </>
  );
}

export default App;

